/**
 * 设置模块路由
 */

const settingsRouter = {
    path: 'settings',
    component: resolve => require(['@/views/settings/index'], resolve),
    children: [
        {
            path: 'auth',
            name: 'Auth',
            component: resolve => require(['@/views/settings/auth'], resolve),
            meta: {
                authList: {
                // 浏览页面
                    auth_page: [
                        '__auto_by_action:__local-system\\auth_group\\get_list',
                        '__auto_by_action:__local-system\\auth\\get_list'
                    ],
                    // 编辑
                    auth_edit: '__auto_by_action:__local-system\\auth\\set_auth_group'
                },
                authResult: {}
            }
        },
        {
            path: 'auth-group',
            name: 'AuthGroup',
            component: resolve => require(['@/views/settings/auth-group'], resolve),
            meta: {
                authList: {
                // 浏览页面
                    auth_page: '__auto_by_action:__local-system\\auth_group\\get_list',
                    // 编辑
                    auth_edit: '__auto_by_action:__local-system\\auth_group\\set_groups'
                },
                authResult: {}
            }
        },
        {
            path: 'user-list',
            name: 'UserList',
            component: resolve => require(['@/views/settings/user-list'], resolve),
            meta: {
                authList: {
                // 浏览页面
                    auth_page: '__auto_by_action:__local-system\\user\\get_list',
                    // 设置用户状态
                    auth_status: '__auto_by_action:__local-system\\user\\set_status',
                    // 新增用户
                    auth_add: '__auto_by_action:__local-system\\user\\add',
                    // 查看用户所属分组
                    auth_view_group: [
                        '__auto_by_action:__local-system\\user_group\\get_list',
                        '__auto_by_action:__local-system\\user\\get_user_group'
                    ],
                    // 设置用户所属分组
                    auth_set_group: [
                        '__auto_by_action:__local-system\\user\\get_user_group',
                        '__auto_by_action:__local-system\\user_group\\get_list',
                        '__auto_by_action:__local-system\\user\\set_user_group',
                    ],
                    // 编辑
                    auth_edit: [
                        '__auto_by_action:__local-system\\user\\set',
                        '__auto_by_action:__local-system\\user\\reset_password'
                    ],
                    //删除用户
                    auth_delete: '__auto_by_action:__local-system\\user\\delete'
                },
                authResult: {}
            }
        },
        { // 岗位管理
            path: 'company-post-list',
            name: 'companyPostList',
            component: resolve => require(['@/views/settings/company-post-list'], resolve),
            meta: {
                authList: {},
                authResult: {}
            }
        },{ // 部门管理
            path: 'company-department-list',
            name: 'companyDepartmentList',
            component: resolve => require(['@/views/settings/company-department-list'], resolve),
            meta: {
                authList: {},
                authResult: {}
            }
        },
        {
            path: 'user-group-list',
            name: 'UserGroupList',
            component: resolve => require(['@/views/settings/user-group-list'], resolve),
            meta: {
                authList: {
                // 浏览页面
                    auth_page: '__auto_by_action:__local-system\\user_group\\get_list',
                    // 新增
                    auth_add: [
                        '__auto_by_action:__local-system\\auth_group\\get_list',
                        '__auto_by_action:__local-system\\auth\\get_list',
                        '__auto_by_action:__local-system\\user_group\\add'
                    ],
                    // 编辑
                    auth_edit: [
                        '__auto_by_action:__local-system\\auth_group\\get_list',
                        '__auto_by_action:__local-system\\auth\\get_list',
                        '__auto_by_action:__local-system\\user_group\\get_list',
                        '__auto_by_action:__local-system\\user_group\\set'
                    ]
                }
            }
        },
        {
            path: 'user-group-add',
            name: 'UserGroupAdd',
            component: resolve => require(['@/views/settings/user-group-edit'], resolve),
            meta: {
                authList: {
                    auth_page: [
                        '__auto_by_action:__local-system\\auth_group\\get_list',
                        '__auto_by_action:__local-system\\auth\\get_list',
                        '__auto_by_action:__local-system\\user_group\\add'
                    ]
                },
                authResult: {}
            }
        },
        {
            path: 'user-group-edit',
            name: 'UserGroupEdit',
            component: resolve => require(['@/views/settings/user-group-edit'], resolve),
            meta: {
                authList: {
                    auth_page: [
                        '__auto_by_action:__local-system\\auth_group\\get_list',
                        '__auto_by_action:__local-system\\auth\\get_list',
                        '__auto_by_action:__local-system\\user_group\\get_list',
                        '__auto_by_action:__local-system\\user_group\\set'
                    ]
                },
                authResult: {}
            }
        },
        {
            path: 'service',
            name: 'Service',
            component: resolve => require(['@/views/settings/service'], resolve),
            meta: {
                authList: {
                    auth_page: '__auto_by_action:__local-system\\provider\\get_list',
                    auth_add: '__auto_by_action:__local-system\\provider\\add',
                    auth_status: '__auto_by_action:__local-system\\provider\\set_status',
                    auth_sync: '__auto_by_action:__local-system\\provider\\sync',
                    auth_edit: '__auto_by_action:__local-system\\provider\\set'
                },
                authResult: {}
            }
        }
    ]
};

export default settingsRouter;
